home *** CD-ROM | disk | FTP | other *** search
- Path: wndrwrks.demon.co.uk!andy
- From: Andy Armstrong <andy@wndrwrks.demon.co.uk>
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel
- Subject: Re: Hungarian notation
- Date: Fri, 5 Jan 1996 10:40:25 +0000
- Organization: WonderWorks
- Distribution: world
- Message-ID: <HtlknJAZAQ7wEwjl@wndrwrks.demon.co.uk>
- References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com>
- <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com>
- <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie>
- <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg>
- <4behis$3cl@dux.dundee.ac.uk> <RIGOTTI.95Dec29100514@roach.dra.hmg.gb>
- <4cd8fc$oud@news.manawatu.gen.nz>
- NNTP-Posting-Host: wndrwrks.demon.co.uk
- X-NNTP-Posting-Host: wndrwrks.demon.co.uk
- MIME-Version: 1.0
- X-Newsreader: Turnpike Version 1.10 <qBJsdVzqmTD$H3HpwSrFWKs0Aw>
-
- In article <4cd8fc$oud@news.manawatu.gen.nz>, Chris Tutty
- <ctutty@manawatu.gen.nz> writes
- >I've always disliked HN, not only because it can make the variable
- >names less readable, but because it violates a basic principle - that
- >of avoiding unnecessary redundancy.
- >
- >My opionion: HN should not be used in any typed language because it
- >creates an opportunity for the actual declared type of a variable
- >(which the machine uses) to be different from it's HN prefix (which
- >the programmer uses).
- >
- >This is the sort of thing that causes maintenance problems. To find
- >out a variable's type you should always search for the initial
- >declaration. To make a type-dependent decision on the basis of a
- >comment is asking for trouble.
-
- I take this point, but think about what it says about comments, white
- space and indenting. In each case one trusts that the programmer has
- these right; there's no way the compiler will check.
-
- Consider also that variable names may be misleading anyway. In that
- sense there's no great difference between
-
- someProc(MyString)
-
- and
-
- someProc(pszMyString)
-
- either could quite happily refer to any other data type.
-
- Perhaps what's needed if Hungarian is adopted is optional compiler
- warnings to verify that HN names are actually correct?
-
- Andy Armstrong WonderWorks
- Phone/fax: 01665 602868 Mobile: 0860 922719
-